package ${package}.com.be.beadmin.device.entity;

import com.be.beadmin.common.com.be.beadmin.device.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;


/**
* @website
* @description /
* @author ${author}
* @date ${date}
**/
@Entity
@Getter
@Setter
@Table(name="${tableName}")
public class ${className} extends  BaseEntity {
<#if columns??>
    <#list columns as column>

    <#if column.columnKey = 'PRI'>
    @Id
    <#if auto>
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    </#if>
        </#if>
    @Column(name = "`${column.columnName}`"<#if column.columnKey = 'UNI'>,unique = true</#if><#if column.istNotNull && column.columnKey != 'PRI'></#if>,nullable = false,columnDefinition = "COMMENT '${column.remark}'")
    <#if column.istNotNull && column.columnKey != 'PRI'>
        <#if column.columnType = 'String'>
    @NotBlank
        <#else>
    @NotNull
        </#if>
    </#if>
    <#if (column.dateAnnotation)?? && column.dateAnnotation != ''>
        <#if column.dateAnnotation = 'CreationTimestamp'>
    @CreationTimestamp
    <#else>
    @UpdateTimestamp
    </#if>
    </#if>
    private ${column.columnType} ${column.changeColumnName};
    </#list>
</#if>


}
